package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.domain.db.QuizReport;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface QuizReportMapper extends BaseMapper<QuizReport> {
    /**
     * 根据分数查询临近用户id
     *
     * @param score
     * @param i
     * @return
     */
    @Select("select user_id from tb_quiz_report where user_id != #{userId} order by abs(#{score}-score) limit #{i}")
    Integer[] queryRangeUserReport(@Param("userId") Integer userId, @Param("score") Integer score, @Param("i") int i);
}
